<?php
require_once VIEW.'/home/header.view.php';
?>
<div id="mainbody">
    <div class="main">
        <ul class="switchs">
            <li id="s1">基本信息</li>
            <li id="s2" class="c">联系方式</li>
            <li id="s3" class="c">银行帐号</li>
            <li id="s4" class="c">帐户统计</li>
        </ul>
        <div class="info">
            <form name="add_save" action="<?=$basepath?>_save"  method="POST" target="ajax" func="form_submit">
                <div id="infos1">
                    <dl><dt>玩家UID：</dt><dd><?=$data['uid']?><input type="hidden" name="uid" value="<?=$data['uid']?>" </dd>
                        <dt>注册IP：</dt><dd><?=long2ip($data['regip'])?></dd>
                        <dt>最后登录IP：</dt><dd><?=(!empty($data['lastip']) ? long2ip($data['lastip']) : '-')?></dd>
                        <dt>注册时间：</dt><dd><?=$this->formatTimes($data['regtimes'])?></dd></dl>
                    <dl><dt>昵称关系：</dt><dd><?=$parents['nicknames']?></dd></dl>
                    <dl><dt>号码关系：</dt><dd><?=$parents['unos']?></dd></dl>
                    <dl><dt>帐户余额：</dt><dd><?=$data['coin']?></dd><dt>积分余额：</dt><dd><?=$data['score']?></dd></dl>
                    <dl><dt>充值总额：</dt><dd><?=$data['recharge']?></dd><dt>提现总额：</dt><dd><?=$cash['_TOTAL']?></dd></dl>
                    <dl><dt>玩家帐号：</dt><dd><?=($data['nickname'])?>【<?=$data['uno']?>】<?=(empty($data['username']) ? '【--】' : '【'.$data['username'].'】')?></dd></dl>
                    <dl><dt>玩家类型：</dt><dd><select name="usertype">
                        <option value="0"<?=($data['usertype']==0 ? ' selected="selected"' : '')?>>试玩玩家</option>
                        <option value="1"<?=($data['usertype']==1 ? ' selected="selected"' : '')?>>普通会员</option>
                        <option value="2"<?=($data['usertype']==2 ? ' selected="selected"' : '')?>>代理玩家</option>
                        <option value="3"<?=($data['usertype']==3 ? ' selected="selected"' : '')?>>内部会员</option>
                    </select></dd></dl>
                    <dl><dt>代理等级：</dt><dd><select name="agentlevel">
                            <? foreach ($agentlevel as $k=>$v) { ?>
                            <option value="<?=$k?>"<?=($data['agentlevel']==$k ? ' selected="selected"' : '')?>><?=$v?></option>
                            <? } ?>
                            </select></dd>
                    </dl>
                    <dl><dt>用户等级：</dt><dd><select name="userlevel">
                                <option value="0">预备</option>
                                <? foreach ($userlevel as $k=>$v) { ?>
                                <option value="<?=$k?>"<?=($data['userlevel']==$k ? 'selected="selected"' : '')?>><?=$v?></option>
                                <? } ?>
                            </select></dd>
                    </dl>
                    <dl><dt>登录密码：</dt>
                        <dd><input type="text" name="passwd" class="int" placeholder="不修改请留空" /></dd>
                    </dl>
                </div>
                <div id="infos2" style="display:none">
                    <dl><dt>联系电话：</dt>
                        <dd><input type="text" name="tel" class="int" value="<?=$data['tel']?>" /></dd>
                    </dl>
                    <dl><dt>微信帐号：</dt><dd><input type="text" name="wx" class="int" value="<?=$data['wx']?>" /></dd></dl>
                    <dl><dt>QQ号码：</dt><dd><input type="text" name="qq" class="int" value="<?=$data['qq']?>" /></dd></dl>
                </div>
                <div id="infos3" style="display:none">
                    <? if(!$banks){ ?>
                        <dl><dt></dt><dd>用户还没有绑定提款银行帐号</dd></dl>
                    <? }else{ ?>
                        <? foreach ($banks as $val){ ?>
                            <dl><dt><?=$val['title']?></dt><dd><?=$val['name']?></dd><dd><?=$val['account']?></dd><dd><?=$val['openadds']?></dd></dl>
                        <? } ?>
                    <? } ?>
                </div>
                <div id="infos4" style="display:none">
                    <dl><dt>帐户余额：</dt><dd><?=$data['coin']?></dd></dl>
                    <dl><dt>充值总额：</dt><dd><?=$data['recharge']?></dd></dl>
                    <dl><dt>提现总额：</dt><dd><?=$cash['_TOTAL']?></dd></dl>
                    <dl><dt>参与金额：</dt><dd><?=$data['betcoin']?></dd></dl>
                    <dl><dt>盈亏统计：</dt><dd><?=$data['profit']?></dd>
                        <dd><a href="/cache/update?key=<?=$redisKey?>" class="button icon-undo" target="ajax" func="loadpage" title="更新Redis缓存"></a></dd>
                    </dl>
                    <dl><dt>有效参与：</dt><dd><table>
                                    <? foreach ($userSum as $val){ ?>
                                        <tr><td><?=$val['title']?>：</td><td><?=($val['count']>0 ? $val['count'] : '--')?></td></tr>
                                    <? } ?>
                                </table></dd>
                    </dl>
                </div>
                <div class="btndiv">
                    <input type="submit" value="确认" class="btnbig confirm" />
                    <input type="button" onclick="javascript:closeColorBox()" class="btnbig" value="取消" />
                </div>
            </form>
            <div class="bottomline"></div>
        </div>
    </div>
</div>
<script>
    $(function () {
        $(".switchs li").live("click", function () {
            $(".switchs li").addClass("c");
            $(this).removeClass("c");
            $(".info div").css("display", "none");
            $("#info" + $(this).attr("id")).css("display", "block");
            $("#info" + $(this).attr("id") + " div").css("display", "block");
            $("#info" + $(this).attr("id") + " div.hiddencontentdiv").css("display", "none");
            $(".info div.btndiv").css("display", "block");
        });
    })
</script>
<?php
require_once VIEW.'/home/footer.view.php';
?>